// var i;
// var AL_GAME_HUA_PlatformButton = require("./AL_GAME_HUA_PlatformButton");
// var c = cc._decorator;
// var l = c.ccclass;
// var u =
//     (c.property,
//     (function (e) {
//         function t() {
//             return (null !== e && e.apply(this, arguments)) || this;
//         }
//         __extends(t, e);
//         t.prototype.onLoad = function () {
//             "wx" == ailin_sdk_manager.getSysPlatformName() ? e.prototype.onLoad.call(this) : (this.node.active = !1);
//         };
//         t.prototype.chuangjian_anniu = function () {
//             return wx.createUserInfoButton({
//                 type: "text",
//                 text: " ",
//                 style: {
//                     backgroundColor: "#00000001",
//                     color: "#ffffff01"
//                 }
//             });
//         };
//         t.prototype.onDestroy = function () {
//             AL_APP_SDK_MANAGER.off(this);
//             if (e.prototype.onDestroy) {
//                 e.prototype.onDestroy.call(this);
//             }
//         };
//         return __decorate([l], t);
//     })(AL_GAME_HUA_PlatformButton.default));
// exports.default = u;


const PlatformButton = require("./AL_GAME_HUA_PlatformButton");
const { ccclass, property } = cc._decorator;

/**
 * @class PlatformButtonExtended
 * @extends PlatformButton
 * @description 扩展自 AL_GAME_HUA_PlatformButton，适用于特定平台
 */
@ccclass
class PlatformButtonExtended extends PlatformButton.default {
    
    /**
     * @memberof PlatformButtonExtended
     * @description 当节点加载时调用，检查平台
     */
    onLoad() {
        if (ailin_sdk_manager.getSysPlatformName() === "wx") {
            super.onLoad();
        } else {
            this.node.active = false;
        }
    }

    /**
     * @memberof PlatformButtonExtended
     * @description 创建用户信息按钮
     * @returns {Object} 用户信息按钮对象
     */
    chuangjian_anniu() {
        return wx.createUserInfoButton({
            type: "text",
            text: " ",
            style: {
                backgroundColor: "#00000001",
                color: "#ffffff01"
            }
        });
    }

    /**
     * @memberof PlatformButtonExtended
     * @description 当节点销毁时调用，移除相关事件监听
     */
    onDestroy() {
        AL_APP_SDK_MANAGER.off(this);
        if (super.onDestroy) {
            super.onDestroy();
        }
    }
}

exports.default = PlatformButtonExtended;
